/**
 * 
 */
package com.bj58.data.hadoop.args;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author zhangpeng
 *
 */
public class Output {
	
	public static final String YYYYMMDD = "yyyyMMdd";
	
	public Output(String outputStr)
	{
		SimpleDateFormat dateFormatter = new SimpleDateFormat(YYYYMMDD);
		Calendar calcurrent = Calendar.getInstance();
		calcurrent.add(Calendar.DATE, -1);
		calcurrent.set(Calendar.SECOND, 0);
		calcurrent.set(Calendar.MINUTE, 0);
		calcurrent.set(Calendar.HOUR_OF_DAY, 0);
		Date dataTime = calcurrent.getTime();
		String currentDate = dateFormatter.format(dataTime);
		outputStr = outputStr.replace(YYYYMMDD, currentDate);
		String[] outputAry = outputStr.split(":");
		outputType = outputAry[0];
		sourceName = outputAry[1];
	}
	
	/*导出数据类型*/
	private String outputType;
	
	/*导出数据库名称*/
	private String sourceName;
	
	
	public String getOutputType() {
		return outputType;
	}


	public void setOutputType(String outputType) {
		this.outputType = outputType;
	}

	public String getSourceName() {
		return sourceName;
	}

	public void setSourceName(String sourceName) {
		this.sourceName = sourceName;
	}
	
//	public static void main(String[] args) {
//		Output out = new Output("hdfs:/dsap/resultdata/infostat/ershou/yyyyMMdd");
//		System.out.println(out.getSourceName());
//	}
}
